import time
import yaml
import pytest
from selenium import webdriver
from selenium.webdriver.common.by import By
from a3mall6yue30ri.Tools import Tools

def test_yaml_data():
    with open("yaml.yaml",'r',encoding="utf-8") as file:
        return yaml.safe_load(file)
@pytest.mark.parametrize("data",test_yaml_data())
def test_01_login(data):

    driver=webdriver.Edge()
    driver.maximize_window()
    driver.get("http://10.59.9.12:7001/")
    time.sleep(2)
    driver.find_element(By.LINK_TEXT,'登录').click()
    driver.find_element(By.NAME,"username").send_keys(data["username"])
    driver.find_element(By.NAME,'password').send_keys(data["password"])
    time.sleep(10)
    driver.find_element(By.CLASS_NAME,"finish-btn").click()
    time.sleep(5)

    driver.quit()